package bg.btanev.eightyfour.domain.profile;

import java.util.Collection;
import java.util.List;
import java.util.SortedSet;

import bg.btanev.eightyfour.domain.exception.ProfileUpdateException;

/**
 *
 * @author B.Tanev
 *
 * @param <P>
 *            a {@link Profile} type
 * @param <PE>
 *            a {@link ProfileEvent} type
 */
public interface ProfileEventsUpdateStrategy<P extends Profile<PE>, PE extends ProfileEvent> {
	List<PE> retrieveOnlineProfileEvents(final P profile) throws ProfileUpdateException;

	/**
	 *
	 * @param currentProfileEvents
	 *            the current {@link ProfileEvent}s
	 * @param profileEvents
	 *            the new {@link ProfileEvent}s to be merged into the <code>currentProfileEvents</code>
	 */
	void mergeProfileEvents(final SortedSet<PE> currentProfileEvents, final Collection<PE> profileEvents);
}
